/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.devil.dogs.beans;


import com.devil.dog.enums.ItemType;
import com.devil.dogs.interfaces.RentalItem;
import java.sql.Date;

/**
 *
 * @author
 */
public final class Airplane implements RentalItem {

    private int id, fboID;
    private float hobbsLeftEngine, hobbsLastOverhaul,
            hobbsLastHundred, usableFuel,
            currentFuel, oilCapacity, currentOil;
    private String fuelGrade, oilGrade,
            tailNumber, manufacturer,
            model, imageLocation, planeType;
    private Date dateLastOverhaul, annualDate,
            dateLastHundred;
    private double rate;
    ItemType type;

    /**
     * Default constructor
     */
    public Airplane() {
    }

    public Airplane(int id, int fboID, double rate, float hobbsLeftEngine, float hobbsLastOverhaul, float hobbsLastHundred, float usableFuel, float currentFuel, float oilCapacity, float currentOil, String fuelGrade, String oilGrade, String tailNumber, String manufacturer, String model, Date dateLastOverhaul, Date annualDate, Date dateLastHundred, String type, String planeType) {
        this.id = id;
        this.fboID = fboID;
        this.planeType = planeType;
        this.rate = rate;
        this.hobbsLeftEngine = hobbsLeftEngine;
        this.hobbsLastOverhaul = hobbsLastOverhaul;
        this.hobbsLastHundred = hobbsLastHundred;
        this.usableFuel = usableFuel;
        this.currentFuel = currentFuel;
        this.oilCapacity = oilCapacity;
        this.currentOil = currentOil;
        this.fuelGrade = fuelGrade;
        this.oilGrade = oilGrade;
        this.tailNumber = tailNumber;
        this.manufacturer = manufacturer;
        this.model = model;
        this.dateLastOverhaul = dateLastOverhaul;
        this.annualDate = annualDate;
        this.dateLastHundred = dateLastHundred;
        this.type = ItemType.valueOf(type);
    }

    @Override
    public int getId() {
        return this.id;
    }

    @Override
    public void setId(int id) {
        this.id = id;
    }

    @Override
    public double getRate() {
        return this.rate;
    }

    @Override
    public void setRate(double rate) {
        this.rate = rate;
    }

    @Override
    public ItemType getType() {
        return this.type;
    }

    @Override
    public void setType(ItemType type) {
        this.type = type;
    }

    public Date getAnnualDate() {
        return annualDate;
    }

    public void setAnnualDate(Date annualDate) {
        this.annualDate = annualDate;
    }

    public float getCurrentFuel() {
        return currentFuel;
    }

    public void setCurrentFuel(float currentFuel) {
        this.currentFuel = currentFuel;
    }

    public float getCurrentOil() {
        return currentOil;
    }

    public void setCurrentOil(float currentOil) {
        this.currentOil = currentOil;
    }

    public Date getDateLastHundred() {
        return dateLastHundred;
    }

    public void setDateLastHundred(Date dateLastHundred) {
        this.dateLastHundred = dateLastHundred;
    }

    public Date getDateLastOverhaul() {
        return dateLastOverhaul;
    }

    public void setDateLastOverhaul(Date dateLastOverhaul) {
        this.dateLastOverhaul = dateLastOverhaul;
    }

    public int getFboID() {
        return fboID;
    }

    public void setFboID(int fboID) {
        this.fboID = fboID;
    }

    public String getFuelGrade() {
        return fuelGrade;
    }

    public void setFuelGrade(String fuelGrade) {
        this.fuelGrade = fuelGrade;
    }

    public float getHobbsLastHundred() {
        return hobbsLastHundred;
    }

    public void setHobbsLastHundred(float hobbsLastHundred) {
        this.hobbsLastHundred = hobbsLastHundred;
    }

    public float getHobbsLastOverhaul() {
        return hobbsLastOverhaul;
    }

    public void setHobbsLastOverhaul(float hobbsLastOverhaul) {
        this.hobbsLastOverhaul = hobbsLastOverhaul;
    }

    public float getHobbsLeftEngine() {
        return hobbsLeftEngine;
    }

    public void setHobbsLeftEngine(float hobbsLeftEngine) {
        this.hobbsLeftEngine = hobbsLeftEngine;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public float getOilCapacity() {
        return oilCapacity;
    }

    public void setOilCapacity(float oilCapacity) {
        this.oilCapacity = oilCapacity;
    }

    public String getOilGrade() {
        return oilGrade;
    }

    public void setOilGrade(String oilGrade) {
        this.oilGrade = oilGrade;
    }

    public String getTailNumber() {
        return tailNumber;
    }

    public void setTailNumber(String tailNumber) {
        this.tailNumber = tailNumber;
    }

    public float getUsableFuel() {
        return usableFuel;
    }

    public void setUsableFuel(float usableFuel) {
        this.usableFuel = usableFuel;
    }

    public String getImageLocation() {
        return imageLocation;
    }

    public void setImageLocation(String imageLocation) {
        this.imageLocation = imageLocation;
    }

    public String getPlaneType() {
        return planeType;
    }

    public void setPlaneType(String planeType) {
        this.planeType = planeType;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Airplane other = (Airplane) obj;
        if (this.id != other.id) {
            return false;
        }
        if (this.fboID != other.fboID) {
            return false;
        }
        if (Float.floatToIntBits(this.hobbsLeftEngine) != Float.floatToIntBits(other.hobbsLeftEngine)) {
            return false;
        }
        if (Float.floatToIntBits(this.hobbsLastOverhaul) != Float.floatToIntBits(other.hobbsLastOverhaul)) {
            return false;
        }
        if (Float.floatToIntBits(this.hobbsLastHundred) != Float.floatToIntBits(other.hobbsLastHundred)) {
            return false;
        }
        if (Float.floatToIntBits(this.usableFuel) != Float.floatToIntBits(other.usableFuel)) {
            return false;
        }
        if (Float.floatToIntBits(this.currentFuel) != Float.floatToIntBits(other.currentFuel)) {
            return false;
        }
        if (Float.floatToIntBits(this.oilCapacity) != Float.floatToIntBits(other.oilCapacity)) {
            return false;
        }
        if (Float.floatToIntBits(this.currentOil) != Float.floatToIntBits(other.currentOil)) {
            return false;
        }
        if ((this.fuelGrade == null) ? (other.fuelGrade != null) : !this.fuelGrade.equals(other.fuelGrade)) {
            return false;
        }
        if ((this.oilGrade == null) ? (other.oilGrade != null) : !this.oilGrade.equals(other.oilGrade)) {
            return false;
        }
        if ((this.tailNumber == null) ? (other.tailNumber != null) : !this.tailNumber.equals(other.tailNumber)) {
            return false;
        }
        if ((this.manufacturer == null) ? (other.manufacturer != null) : !this.manufacturer.equals(other.manufacturer)) {
            return false;
        }
        if ((this.model == null) ? (other.model != null) : !this.model.equals(other.model)) {
            return false;
        }
        if ((this.imageLocation == null) ? (other.imageLocation != null) : !this.imageLocation.equals(other.imageLocation)) {
            return false;
        }
        if ((this.planeType == null) ? (other.planeType != null) : !this.planeType.equals(other.planeType)) {
            return false;
        }
        if (this.dateLastOverhaul != other.dateLastOverhaul && (this.dateLastOverhaul == null || !this.dateLastOverhaul.equals(other.dateLastOverhaul))) {
            return false;
        }
        if (this.annualDate != other.annualDate && (this.annualDate == null || !this.annualDate.equals(other.annualDate))) {
            return false;
        }
        if (this.dateLastHundred != other.dateLastHundred && (this.dateLastHundred == null || !this.dateLastHundred.equals(other.dateLastHundred))) {
            return false;
        }
        if (Double.doubleToLongBits(this.rate) != Double.doubleToLongBits(other.rate)) {
            return false;
        }
        if (this.type != other.type) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 89 * hash + this.id;
        hash = 89 * hash + this.fboID;
        hash = 89 * hash + Float.floatToIntBits(this.hobbsLeftEngine);
        hash = 89 * hash + Float.floatToIntBits(this.hobbsLastOverhaul);
        hash = 89 * hash + Float.floatToIntBits(this.hobbsLastHundred);
        hash = 89 * hash + Float.floatToIntBits(this.usableFuel);
        hash = 89 * hash + Float.floatToIntBits(this.currentFuel);
        hash = 89 * hash + Float.floatToIntBits(this.oilCapacity);
        hash = 89 * hash + Float.floatToIntBits(this.currentOil);
        hash = 89 * hash + (this.fuelGrade != null ? this.fuelGrade.hashCode() : 0);
        hash = 89 * hash + (this.oilGrade != null ? this.oilGrade.hashCode() : 0);
        hash = 89 * hash + (this.tailNumber != null ? this.tailNumber.hashCode() : 0);
        hash = 89 * hash + (this.manufacturer != null ? this.manufacturer.hashCode() : 0);
        hash = 89 * hash + (this.model != null ? this.model.hashCode() : 0);
        hash = 89 * hash + (this.imageLocation != null ? this.imageLocation.hashCode() : 0);
        hash = 89 * hash + (this.planeType != null ? this.planeType.hashCode() : 0);
        hash = 89 * hash + (this.dateLastOverhaul != null ? this.dateLastOverhaul.hashCode() : 0);
        hash = 89 * hash + (this.annualDate != null ? this.annualDate.hashCode() : 0);
        hash = 89 * hash + (this.dateLastHundred != null ? this.dateLastHundred.hashCode() : 0);
        hash = 89 * hash + (int) (Double.doubleToLongBits(this.rate) ^ (Double.doubleToLongBits(this.rate) >>> 32));
        hash = 89 * hash + (this.type != null ? this.type.hashCode() : 0);
        return hash;
    }
}
